<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>B站搜索结果页</title>
    <link href="css/search.css" rel="stylesheet">
    <link href="css/common.css" rel="stylesheet">
    <script src="http://47.106.66.89:8080/js/vue.min.js"></script>
    <script src="http://47.106.66.89:8080/js/axios.min.js"></script>
    <link  href="http://47.106.66.89:8080/js/ele-2.15.7/theme-chalk/index.css" rel="stylesheet">
    <script src="http://47.106.66.89:8080/js/ele-2.15.7/index.js"></script>
    <script src="/b-user/js/login.js"></script>
    <script src="js/common.js"></script>

</head>
<body>
<div id="app">
    <common></common>

    <!-- 主体内容 -->
    <div class="main-content">
        <!-- 筛选区域 -->
        <div class="filter-group">
            <a href="#" class="filter-tag active">综合</a>
            <a href="#" class="filter-tag ">视频(99+)</a>
            <a href="#" class="filter-tag ">番剧</a>
            <a href="#" class="filter-tag ">影视</a>
        </div>

        <!-- 排序选项 -->
        <div class="sort-group">
            <span><a href="#" class="sort-item">综合排序</a></span>
            <span><a href="#" class="sort-item">最多播放</a></span>
            <span><a href="#" class="sort-item">最新发布</a></span>
            <span><a href="#" class="sort-item">最多弹幕</a></span>
        </div>

        <!-- UP主信息 -->
        <div class="creator-card">
            <img class="avatar" :src="searchUInfo.headimg" @click="location.href = '../me.html?id=' + searchUInfo.id">
            <div style="flex:1">
                <h3>{{searchUInfo.name}}&nbsp;&nbsp;&nbsp;<span style="color:#61666D;font-size:14px">粉丝：{{searchUInfo.fens}} |  视频：{{searchUInfo.videoNum}}</span></h3>
                <p style="color:#9499A0;font-size:13px;margin:8px 0">{{searchUInfo.title}}</p>
                <button class="follow-btn">+ 关注</button>
            </div>
        </div>

        <!-- 视频列表 -->
        <div id="up-video">
            <div class="video-item" v-for="v in newVideo">
                <img class="video-thumb" :src="v.image">
                <div>
                    <h4 class="video-text">{{v.vname}}</h4>
                    <p style="color:#9499A0;font-size:12px;margin:8px 0">1小时前</p>
                </div>
            </div>

        </div>

        <div id="relative-video">
            <div class="re-video-item" v-for="v in video">
                <img class="re-video-thumb" :src="v.image">
                <div>
                    <h4 class="video-text">{{v.vname}}</h4>
                    <p style="color:#9499A0;font-size:12px;margin:8px 0">{{v.name}}1小时前</p>
                </div>
            </div>
        </div>

        <!-- 更多视频项... -->
    </div>
</div>
</body>
<script>
    var v = new Vue({
        el : "#app",
        data : {
            video:{},
            searchUInfo:{},
            newVideo:{},
        },
        created() {
            // 跟具搜索词查找视频
            axios.get("search/searchByText"+location.search).then(res=>{
                this.video = res.data
            })
            // 跟具搜索词查找人
            axios.get("b-user/user/searchUInfo"+location.search).then(res=>{
                this.searchUInfo = res.data
                if(this.searchUInfo){
                    axios.get("b-user/user/getVideoById", {
                        params:{
                            id: this.searchUInfo.id
                        }
                    }).then(res=>{
                        this.newVideo = res.data;
                    })
                }
            })
        },
        methods : {}
    })
</script>

</html>